from rest_framework.views import APIView
from rest_framework.response import Response
# from rest_framework.permissions import ISAuthenticated
from dhm.models.burglary_proof_door.burglary_proof_door import BurglaryProofDoor

class BurglaryProofDoorView(APIView):
    def get(self, request):
        burglaryproofdoor = BurglaryProofDoor.objects.all()
        burglary_proof_door_list = []
        for burglary_proof_door in burglaryproofdoor:
            burglary_proof_door_list.append({
                'id': burglary_proof_door.id,
                'photo': burglary_proof_door.photo,
                'purpose_photo_one': burglary_proof_door.purpose_photo_one,
                'purpose_phone_two': burglary_proof_door.purpose_phone_two,
                'purpose_phone_three': burglary_proof_door.purpose_phone_three,
                'usage': burglary_proof_door.usage,
                'stock': burglary_proof_door.stock,
                'price': burglary_proof_door.price,
                'title': burglary_proof_door.title,
                'size': burglary_proof_door.size,
            })
        return Response(burglary_proof_door_list)
